export default {
	data() {
		return {
			// moreOpts: [
			// 	{ value: "approve", label: "通过", type: 'primary' },
			// 	{ value: "refuse", label: "拒绝" },
			// 	{ value: "reject", label: "驳回" },
			// 	{ value: "recover", label: "恢复" }
			// ]
		}
	},
	methods: {
		optRemarkForm(args) {
			console.log(args);
			this.$crud.openForm({
				title: args.title,
				width: "500px",
				props: {
					"label-position": "top"
				},
				items: [
					{
						label: args.title + '备注',
						prop: "remark",
						component: {
							name: "el-input",
							attrs: { placeholder: `请输入${args.title}备注` },
							props: { type: "textarea", rows: 4 }
						},
						rules: { required: true, message: args.title + "备注不能为空" }
					}
				],
				op: { saveButtonText: "提交" },
				on: {
					submit: async (data, { close, done }) => {
						try {
							await this.$service.oa.audit({
								oa_id: args.oa_id,
								...data
							});
							this.$message.success("操作成功");
							close();
							args.cb && args.cb()
						} catch (e) {
							console.log(e);
							done();
						}
					}
				}
			});
		}
	}
}
